package com.fire.control.system.module.notice.controller.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fire.control.system.module.common.controller.BaseController;
import com.fire.control.system.module.notice.service.NoticeService;
import com.fire.control.system.standard.BusinessInterfaceStandard;
import com.fire.control.system.support.protocol.comman.ResponseProtocol;
import com.fire.control.system.support.protocol.notice.NoticeRequestProtocol;

/**
 * 
 * @ClassName:  NoticeController
 * @Description:  消息通知控制器
 * @author:  xiechengguang
 * @date:  2017年6月9日 下午6:59:20
 *
 */
@RestController
@RequestMapping("/web/notice")
public class NoticeController extends BaseController implements BusinessInterfaceStandard<NoticeRequestProtocol, ResponseProtocol> {
	@Autowired 
	private NoticeService noticeService;
	
	/**
	 * 
	 * @author: xiechengguang 
	 * @Title: getNoticeList   
	 * @Description: 获取消息列表，分页显示  
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/getNoticeList", method = RequestMethod.POST)
	public ResponseProtocol getNoticeList(NoticeRequestProtocol request) {
		return noticeService.getNoticeList(request, getUser());
	}
	
	/**
	 * @author: xiechengguang 
	 * @Title: addNotice   
	 * @Description: 添加消息通知  
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/addNotice", method = RequestMethod.POST)
	public ResponseProtocol addNotice(NoticeRequestProtocol request) {
		return noticeService.addNotice(request, getUser());
	}
	
	/**
	 * @author: xiechengguang 
	 * @Title: getNoticeInfo   
	 * @Description: 消息通知 详细 
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/getNoticeInfo", method = RequestMethod.POST)
	public ResponseProtocol getNoticeInfo(NoticeRequestProtocol request) {
		return noticeService.getNoticeInfo(request);
	}
	
	/**
	 * @author: xiechengguang 
	 * @Title: updateNotice   
	 * @Description: 修改消息通知  
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/updateNotice", method = RequestMethod.POST)
	public ResponseProtocol updateNotice(NoticeRequestProtocol request) {
		return noticeService.updateNotice(request, getUser());
	}
	
	/**
	 * @author: xiechengguang 
	 * @Title: deleteNotice   
	 * @Description: 删除消息通知，实际上修改status  
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/deleteNotice", method = RequestMethod.POST)
	public ResponseProtocol deleteNotice(NoticeRequestProtocol request) {
		return noticeService.deleteNotice(request);
	}
	
	/**
	 * @author: xiechengguang 
	 * @Title: searchNotices   
	 * @Description: 根据条件搜索消息通知  
	 * @param:        
	 * @return: ResponseProtocol      
	 * @throws
	 */
	@RequestMapping(value = "/searchNotices", method = RequestMethod.POST)
	public ResponseProtocol searchNotices(NoticeRequestProtocol request) {
		return noticeService.searchNotices(request, getUser());
	}
	
}
